#define _CRT_SECURE_NO_WARNINGS 1
int MoreThanHalfNum_Solution(vector<int>& numbers) {
    // write code here
    int half = numbers.size() / 2;
    unordered_map<int, int> map;
    for (int i = 0; i < numbers.size(); i++)
    {
        auto it = map.find(numbers[i]);
        if (it == map.end())
        {
            map.insert({ numbers[i],1 });
        }
        else
        {
            map[numbers[i]]++;
        }
        if (map[numbers[i]] > half)
        {
            return numbers[i];
        }
    }
    return 0;
}